package name.fowler.refactoring.simplestore;

import java.util.ArrayList;
import java.util.List;

class Store {

	private List<Customer> customers = new ArrayList<Customer>();

	public List<Customer> getCustomers() {
		return customers;
	}

	public static void main(String[] args) {

		Store self = new Store();

		// Create movies
		Movie movCinderella = new Movie("Cinderella", PriceCodes.Childrens);
		Movie movStarWars = new Movie("Star Wars", PriceCodes.Regular);
		Movie movGladiator = new Movie("Gladiator", PriceCodes.NewRelease);
		
		// Create customers
		Customer custMickeyMouse = new Customer("Mickey Mouse");
		Customer custDonaldDuck = new Customer("Donald Duck");
		Customer custMinnieMouse = new Customer("Minnie Mouse");

		self.customers.add(custMickeyMouse);
		self.customers.add(custDonaldDuck);
		self.customers.add(custMinnieMouse);

		// Create rentals
		Rental rental1 = new Rental(movCinderella, 5);
		Rental rental2 = new Rental(movStarWars, 5);
		Rental rental3 = new Rental(movGladiator, 5);

		// Assign rentals to customers
		custMickeyMouse.addRental(rental1);
		custDonaldDuck.addRental(rental2);
		custMickeyMouse.addRental(rental3);

		(new CustomerMoviesReport()).report(custMickeyMouse, new TextFormatter(40));
		(new StoreReport()).report(self, new XMLFormatter());
	}
}
